package com.nuonuo.refresh;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author duan
 * @version 1.0
 * @date 2023/1/20 16:23
 */
@SpringBootApplication
public class RefreshScopeApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(RefreshScopeApplication.class, args);
//        String[] beanNames = context.getBeanDefinitionNames();
//        for (String beanName : beanNames) {
//            System.out.println(beanName);
//        }
//        try {
//            Object scopedObj = context.getBean("scopedTarget.testListener");
//            System.out.println("scopedObj: " + scopedObj);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        Object obj = context.getBean("testListener");
//        System.out.println("obj: " + obj);
    }
}
